import feedparser

feeds={}
feeds['world'] = 'http://hosted2.ap.org/atom/APDEFAULT/cae69a7523db45408eeb2b3a98c0c9c5'
feeds['technology'] = 'http://hosted2.ap.org/atom/APDEFAULT/495d344a0d10421e9baa8ee77029cfbd'
feeds['science'] = 'http://hosted2.ap.org/atom/APDEFAULT/b2f0ca3a594644ee9e50a8ec4ce2d6de'
feeds['national'] = 'http://hosted2.ap.org/atom/APDEFAULT/386c25518f464186bf7a2ac026580ce7'
feeds['politics'] = 'http://hosted2.ap.org/atom/APDEFAULT/89ae8247abe8493fae24405546e9a1aa'

def get_news(news_type):
    news = feedparser.parse(feeds[news_type])
    titles = [entry.title for entry in news['entries']]
    
    return titles

if __name__ == '__main__':
    print get_news()
